<template>
  <!-- 这个组件的意思是继续测试以及熟悉v-model -->
  <el-form-item label="状态">
      <!-- el-radio的数据改变的监听方法是change -->
    <el-radio-group v-model="statusCode" @change="statusChange">
        <el-radio>全部</el-radio>
        <el-radio :label="0">草稿</el-radio>
        <el-radio :label="1">待审核</el-radio>
        <el-radio :label="2">审核通过</el-radio>
        <el-radio :label="3">审核失败</el-radio>
        <el-radio :label="4">已删除</el-radio>
    </el-radio-group>
  </el-form-item>
</template>

<script>
export default {
  props: {
    value: {
      type: Number
    }
  },
  watch: {
    value: function (val) {
      this.statusCode = val
    }
  },
  data () {
    return {
      statusCode: this.value
    }
  },
  methods: {
    statusChange () {
      this.$emit('input', this.statusCode)
    }
  }
}
</script>

<style>

</style>
